package yxy.game.pm2.module.union.rank;

import org.redisson.api.RScoredSortedSet;
import yxy.game.pm2.bean.module.rank.PlayerRankModule;

/** 有活跃表现的联盟排名 */
public class RankActiveUnion extends UnionRankModule {

	private int clusterId; //专服id

	public int getClusterId() {
		return clusterId;
	}

	public void setClusterId(int clusterId) {
		this.clusterId = clusterId;
	}

	public RankActiveUnion(int clusterId) {
		setClusterId(clusterId);
		initInfo();
	}

	@Override
	protected String rankKey() {
		return String.format("UNIONRANK:%s:%s", getClusterId(), rankName());
	}


	@Override
	public String rankName() {
		return PlayerRankModule.getAllRankNames().get(15);
	}

	@Override
	protected boolean reconsitution() {
		return false;
	}

	@Override
	protected long valuePlastic(long value) {
		return value;
	}

	@Override
	protected long valueRestore(long score) {
		return score;
	}

	@Override
	protected void addScore(String unionCode, long value) {
		RScoredSortedSet<String> zset = touch();
		zset.add(value, unionCode);
	}
}
